//
//  MeThingTableViewCell.swift
//  约健
//
//  Created by tyh on 2017/9/14.
//  Copyright © 2017年 tyh. All rights reserved.
//

import UIKit

class MeThingTableViewCell: UITableViewCell {
    var TittleLabel:UILabel!
    var LoginBtn:UIButton!
    let radio:CGFloat = 0.2
    let widthboom = width/36
    let heightboom = height*0.2/20

    override func awakeFromNib() {
        super.awakeFromNib()
        
        TittleLabel = UILabel()
        TittleLabel.font = UIFont.systemFont(ofSize: 15)
        TittleLabel.textColor = UIColor.gray
        self.contentView.addSubview(TittleLabel)
        
        if user_id == "-1"{
            
            LoginBtn = UIButton()
            LoginBtn.setTitle("加入课程", for: .normal)
            LoginBtn.setTitleColor(UIColor.black, for: .normal)
            LoginBtn.backgroundColor = UIColor(displayP3Red: 0, green: 0, blue: 0, alpha: 0)
            LoginBtn.layer.borderWidth = 1
            LoginBtn.layer.borderColor = UIColor.black.cgColor
            LoginBtn.layer.cornerRadius = 10
            self.contentView.addSubview(LoginBtn)
            
        }
        else{
            
        }
        
    }
    override func layoutSubviews() {
        super.layoutSubviews()
        TittleLabel.frame = CGRect(x: widthboom, y: heightboom, width: width/5, height: heightboom*3)
        if user_id == "-1"{
        LoginBtn.frame = CGRect(x: widthboom*9, y: heightboom*8, width: widthboom*18, height: heightboom*5)
        }else{
            
        }
        
        
    }


    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

       
    }

}
